import 'package:flutter/material.dart';
import 'package:flutter_deer/account/iview/withdraw_password_sms_iview.dart';
import 'package:flutter_deer/mvp/base_page_presenter.dart';
import 'package:flutter_deer/net/base_entity.dart';
import 'package:flutter_deer/net/dio_utils.dart';
import 'package:flutter_deer/net/http_api.dart';


class WithdrawPasswordSmsPresenter extends BasePagePresenter<WithdrawPasswordSmsIMvpView> {

  @override
  void initState() {
  }

  Future<dynamic> sendWithdrawPasswordSmsCode() async {
    WidgetsBinding.instance.addPostFrameCallback((_) {
      requestNetwork<OperatorBaseEntity>(Method.get,
          url: HttpApi.withdrawPasswordSmsCode,
          onSuccess: (data) {
            view.setSendSmsResult(data!.data);
            if(data!.data==true){
              view.setSmsCode(data!.message);
            }
          },
          onError: (error,msg){

          }
      );
    });
  }
}